const path = require('path')
const bootstrap = require('commitizen/dist/cli/git-cz').bootstrap
const commitlint = require('../commitlint.config')
const cp = require('child_process')
const util = require('util')
const exec = util.promisify(cp.exec)

module.exports = async function autoCommitizen(program) {
  bootstrap({
    cliPath: path.join(__dirname, '../node_modules/commitizen'),
    // this is new
    config: {
      path: 'cz-conventional-changelog',
    },
  })
}
